<template>
  <div>
    <detail-banner :sightName="sightName" :bannerImg="bannerImg" :gallaryImgs="gallaryImgs"></detail-banner>
    <detail-header></detail-header>
    <div class="conters">
      <detail-list :List="List"></detail-list>
    </div>
  </div>
</template>
<script type="text/ecmascript-6">
import detailBanner from './components/Banner'
import detailHeader from './components/Header'
import detailList from './components/List'
import axios from 'axios'
export default {
  name: 'Detail',
  components: {
    detailBanner,
    detailHeader,
    detailList
  },
  data () {
    return {
      sightName: '',
      bannerImg: '',
      gallaryImgs: [],
      List: []
    }
  },
  methods: {
    detailList () {
      axios.get('/api/detail.json', {
        params: {
          id: this.$route.params.id
        }
      }).then((res) => {
        res = res.data
        console.log(res)
        this.sightName = res.data.sightName
        this.bannerImg = res.data.bannerImg
        this.gallaryImgs = res.data.gallaryImgs
        this.List = res.data.categoryList
      })
    }
  },
  mounted () {
    this.detailList()
  }
}
</script>
<style lang="stylus" scoped>
</style>
